package com.borya.model.db;

/**
 * 保存喜牛的配置信息
 */
public class ProConf {

    private int warefeeUnitPrice;//公益金 单个设备增加公益金，分
    private int warefeeDefaultNum;//公益金 默认已售卖设备
    private int withdrawMinFee;//提现最低额度，元
    private int chargeType;//出账方式；1自动出账，2手动出账
    private String sellcardPower;//分享号码库权限，值为商户等级，多个用,连接
    private String sellcardUrl;//分享地址
    public void setValue(String name, String value){
        switch (name){
            case "warefee_unitprice":
                setWarefeeUnitPrice(Integer.parseInt(value));
                break;
            case "warefee_default_num":
                setWarefeeDefaultNum(Integer.parseInt(value));
                break;
            case "withdraw_min_fee":
                setWithdrawMinFee(Integer.parseInt(value));
                break;
            case "charge_type":
                setChargeType(Integer.parseInt(value));
                break;
            case "sellcard_power":
                setSellcardPower(value);
                break;
            case "sellcard_url":
                setSellcardUrl(value);
                break;
            default:
                break;
        }
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ProConf{");
        sb.append("warefeeUnitPrice=").append(warefeeUnitPrice);
        sb.append(", warefeeDefaultNum=").append(warefeeDefaultNum);
        sb.append(", withdrawMinFee=").append(withdrawMinFee);
        sb.append(", chargeType=").append(chargeType);
        sb.append(", sellcardPower='").append(sellcardPower).append('\'');
        sb.append(", sellcardUrl='").append(sellcardUrl).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public String getSellcardPower() {
        return sellcardPower;
    }

    public void setSellcardPower(String sellcardPower) {
        this.sellcardPower = sellcardPower;
    }

    public String getSellcardUrl() {
        return sellcardUrl;
    }

    public void setSellcardUrl(String sellcardUrl) {
        this.sellcardUrl = sellcardUrl;
    }

    public int getChargeType() {
        return chargeType;
    }

    public void setChargeType(int chargeType) {
        this.chargeType = chargeType;
    }

    public int getWarefeeUnitPrice() {
        return warefeeUnitPrice;
    }

    public void setWarefeeUnitPrice(int warefeeUnitPrice) {
        this.warefeeUnitPrice = warefeeUnitPrice;
    }

    public int getWarefeeDefaultNum() {
        return warefeeDefaultNum;
    }

    public void setWarefeeDefaultNum(int warefeeDefaultNum) {
        this.warefeeDefaultNum = warefeeDefaultNum;
    }

    public int getWithdrawMinFee() {
        return withdrawMinFee;
    }

    public void setWithdrawMinFee(int withdrawMinFee) {
        this.withdrawMinFee = withdrawMinFee;
    }
}
